//% color="#9F32F1" iconWidth=50 iconHeight=40
namespace URM09TRIG {

    //% block="Read ult distance trig [PIN] in cm" blockType="reporter" 
    //% PIN.shadow="dropdown" PIN.options="PIN"
  
    export function read_dis_urm09(parameter: any, block: any) {
        let pin = parameter.PIN.code
        Generator.addInclude("UltrasonicSensor_L", "#include <UltrasonicSensor_L.h>");
        Generator.addObject(`UltrasonicSensor`, `UltrasonicSensor`, `sensor;`);
        Generator.addCode(`sensor.getDistanceCM(${pin})`);
    }
}

